function isDate(fld, detail, show_alert)
{
	str = fld.value;
	if (str=='')
		return true;
  var temp = true;
  var re = /^(\d{1,2})[\s\.\/-](\d{1,2})[\s\.\/-](\d{4})$/
  if (!re.test(str)) 
  {
	if (show_alert)
	{
		alert("Invalid " + detail + ": '" + str + "', please try again... format [DD/MM/YYYY]");
		fld.value = '';
		fld.focus();
	}
	return false;
  }
  var result = str.match(re);
  var m = parseInt(result[2]);
  var d = parseInt(result[1]);
  var y = parseInt(result[3]);
  if(m < 1 || m > 12 || y < 1900 || y > 2100) 
  {
	if (show_alert)
	{
		alert("Invalid " + detail + ": '" + str + "', please try again... format [DD/MM/YYYY]");
		fld.value = '';
		fld.focus();
	}
	return false;
  }
  if(m == 2){
          var days = ((y % 4) == 0) ? 29 : 28;
  }else if(m == 4 || m == 6 || m == 9 || m == 11){
          var days = 30;
  }else{
          var days = 31;
  }
  temp = (d >= 1 && d <= days);
  if (temp == false)
  {
  	if (show_alert)
	{
		alert("Invalid " + detail + ": '" + str + "', please try again... format [DD/MM/YYYY]");
		fld.value = '';
		fld.focus();
	}
	return false;
  }
}